/*
 * Copyright 2008 Federal Emergency Management Agency
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 *    http://www.apache.org/licenses/LICENSE-2.0 
 *    
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and 
 * limitations under the License. 
 *  
 */
package gov.fema.hazus.bdc.shared.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class Location implements Serializable {

	@Id Long id;
	private static final long serialVersionUID = 8693901473565478256L;
	
	private double latitude;
	private double longitude;
	private String censusBlock;
	private String censusGroup;
	private String censusTract;
	private String countyFIPS;
	
	// constants
	public static final String FIELD_LATITUDE = "latitude";
	public static final String FIELD_LONGITUDE = "longitude";
	public static final String FIELD_CENSUSBLOCK = "census block";
	public static final String FIELD_CENSUSGROUP = "census group";
	public static final String FIELD_CENSUSTRACT = "census tract";
	public static final String FIELD_COUNTYFIPS = "county FIPS";
	
	public Location()
	{
		
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}
	
	public String getCensusBlock() {
		return censusBlock;
	}

	public void setCensusBlock(String censusBlock) {
		this.censusBlock = censusBlock;
	}

	public String getCensusGroup() {
		return censusGroup;
	}

	public void setCensusGroup(String censusGroup) {
		this.censusGroup = censusGroup;
	}

	public String getCensusTract() {
		return censusTract;
	}

	public void setCensusTract(String censusTract) {
		this.censusTract = censusTract;
	}

	public String getCountyFIPS() {
		return countyFIPS;
	}

	public void setCountyFIPS(String countyFIPS) {
		this.countyFIPS = countyFIPS;
	}

	public String toString()
	{
		String str = "";
		str += "[location";
		str += "[id="+this.id+"]";
		str += "[latitude="+this.latitude+"]";
		str += "[longitude="+this.longitude+"]";
		str += "[census-block="+this.censusBlock+"]";
		str += "[census-group="+this.censusGroup+"]";
		str += "[census-tract="+this.censusTract+"]";
		str += "[census-county-fips="+this.countyFIPS+"]";
		str += "]";
		return str;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
}
